<?php
require "backend/dbHandler.php";
require "backend/Cart.php";
session_start(); 
$DTB =  dbHandler::getInstance();
$cart = new Cart();	

//IF THERE IS A SESSION ALREADY THEN SET $cart TO IT.
if(isset($_SESSION['Cart']))
{
	$cart = $_SESSION['Cart'];
}
//IF NO SESSION SET THEN ADD NEW CART TO SESSION>
else 
{
	$_SESSION['Cart']= $cart;
}
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Thai Bistro</title>
		<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
		
		
<SCRIPT TYPE="text/javascript">
<!--
// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

//-->
</SCRIPT>
		
		
		
	</head>
	
	<body class="twoColumnFixedHeader">
	<div id="container">
	
	<div id="statictop">
	<h1>&nbsp</h1>
	<p>&nbsp</p>
	
	</div>
	<div id = "sidemenu">
	<ul id= "MenuBar" class= "MenuBarVertical">
		<li>
		<a href='index.php'>Home</a>
		</li>
		<li>
		<a href='Menu.php'>Food Menu</a>
		</li>
		<li>
		<a href='Login.php'>Customer Login</a>
		</li>
		<li>
		<a href='shoppingCart.php'>Cart[<?php $index = $cart->returnIndex(); echo "$index"?>]</a>
		</li>
		<li>
		<a href='logout.php'>Logout</a>
		</li>
		<li>
		New to Thai Bistro? Please: 
		<a href='Register.php'>Register</a>
		</li>
		<br>
		</br>
	</ul>
	</div>
	
	